<?php

namespace App\Http\Controllers;

use App\Services\ActivityService;
use App\Exceptions\ValidationException;
use App\Http\Controllers\BaseController;

class ActivityController extends BaseController
{
    public function __construct(ActivityService $activityService)
    {
        $this->activityService = $activityService;
    }

    public function index()
    {
        $param = [];
        $data = $this->activityService->getList($param);

        return $this->response->success($data);
    }

    public function show($id)
    {
        if (!$id) {
            throw new ValidationException('缺失参数');
        }

        $result = $this->activityService->getInfo($id);

        return $this->response->success($result);
    }

}
